'use strict';

let Koa=require('koa');
let bodyParser=require('koa-bodyparser');
let controller=require('./controllers');
let temp=require('./templating');
let staticRes=require('koa-static');

let app=new Koa();
app.use(temp);
app.use(bodyParser());
app.use(controller());
app.use(staticRes(__dirname+'/statics'));

app.use(async(ctx,next)=>{
    ctx.render('hello.html');
})

let port=3000;

app.listen(port);

console.log(`http://127.0.0.1:${port}`);